package com.bean;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;

import com.sun.tools.javac.comp.Check;


/**
 * ParkOrder entity. @author MyEclipse Persistence Tools
 */

public class ParkOrder  implements java.io.Serializable {


    // Fields    

     /** serialVersionUID*/
	private static final long serialVersionUID = 4303648593177945690L;
	private Long poId;
     private Userinfo userinfo;
     private Parkinfo parkinfo;
     private ParkManager parkManagerByLeaveOperatorId;
     private ParkManager parkManagerByEnterOperatorId;
     private ParkManager parkManagerByReservationOperatorId;
     private String poNo;
     private Short poType;
     private String typeName;
     private String carNo;
     private Timestamp orderTime;
     private String carColor;
     private String carBrand;
     private Timestamp enterTime;
     private Timestamp leaveTime;
     private Long enterImg;
     private Long leaveImg;
     private Double reservationDuration;
     private Double actualDuration;
     private Double reservationAmount;
     private Double receivableAmount;
     private Double actualAmount;
     private Double diffAmount;
     private String extendInfo;//收费信息扩展字段json,使用ParkOrderExt解析
     private String changeAmountReason;
     private Short carportCount;
     private Short commentStatus;
     private Short reportStatus;
     private Timestamp createTime;
     private Timestamp updateTime;
     private Short status;
     private String statusName;
     private Set parkReports = new HashSet(0);
     private Set userCreditRecords = new HashSet(0);
     private Set transactionRecords = new HashSet(0);
     private Set parkComments = new HashSet(0);
     
    private Long countOrder;
 	private Integer year;
 	private Integer month;
 	private Integer day;
 	private Double shimoney;//实际
 	private Double yinmoney;//应收
 	private Double chamoney;//差额
 	private Long countType;
 	private Double summoney;
 	

    // Constructors

    /** default constructor */
    public ParkOrder() {
    }
    
    public ParkOrder(Double summoney, Short status) {
    	this.summoney = summoney;
    	this.status = status;
    }
    
    
    public ParkOrder(Double shimoney,Double yinmoney,Double chamoney,Short status) {
    	this.shimoney=shimoney;
    	this.chamoney=chamoney;
    	this.yinmoney=yinmoney;
    	this.status=status;
    }
    public ParkOrder(Double shimoney,Double yinmoney,Double chamoney) {
    	this.shimoney=shimoney;
    	this.chamoney=chamoney;
    	this.yinmoney=yinmoney;
    }
    public ParkOrder(Double shimoney,Double yinmoney,Double chamoney,Integer year,Short status) {
    	this.shimoney=shimoney;
    	this.chamoney=chamoney;
    	this.year=year;
    	this.yinmoney=yinmoney;
    	this.status=status;
    }
    public ParkOrder(Double shimoney,Double yinmoney,Double chamoney,Integer year,Integer month,Short status) {
    	this.shimoney=shimoney;
    	this.chamoney=chamoney;
    	this.year=year;
    	this.month=month;
    	this.yinmoney=yinmoney;
    	this.status=status;
    }
    public ParkOrder(Double shimoney,Double yinmoney,Double chamoney,Integer year,Integer month,Integer day,Short status) {
    	this.yinmoney=yinmoney;
    	this.chamoney=chamoney;
    	this.year=year;
    	this.month=month;
    	this.day=day;
    	this.shimoney=shimoney;
    	this.status=status;
    }
    public ParkOrder(Short status,Long countOrder){
    	this.status=status;
    	this.countOrder=countOrder;
    }
    public ParkOrder(Long countOrder){
    	this.countOrder=countOrder;
    }
    public ParkOrder(Integer year,Short status,Long countOrder) {
    	this.status=status;
    	this.countOrder=countOrder;
    	this.year=year;
    }
    public ParkOrder(Integer year,Integer month,Short status,Long countOrder) {
    	this.status=status;
    	this.countOrder=countOrder;
    	this.year=year;
    	this.month=month;
    }
    public ParkOrder(Integer year,Integer month,Integer day,Short status,Long countOrder) {
    	this.status=status;
    	this.countOrder=countOrder;
    	this.day=day;
    	this.year=year;
    	this.month=month;
    	this.day=day;
    }
    public ParkOrder(Integer year,Integer month,Integer day,Long countOrder) {
    	this.countOrder=countOrder;
    	this.day=day;
    	this.year=year;
    	this.month=month;
    	this.day=day;
    }
//    public ParkOrder(Integer year,Integer month,Integer day,Short status,Long countOrder,Short poType) {
//    	this.status=status;
//    	this.countOrder=countOrder;
//    	this.day=day;
//    	this.year=year;
//    	this.month=month;
//    	this.day=day;
//    	this.poType=poType;
//    }
	/** minimal constructor */
    public ParkOrder(String poNo, Short poType, String carNo, Timestamp createTime, Timestamp updateTime, Short status) {
        this.poNo = poNo;
        this.poType = poType;
        this.carNo = carNo;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.status = status;
    }
    
    /** full constructor */
    public ParkOrder(ParkManager parkManagerByLeaveOperatorId, Userinfo userinfo, Parkinfo parkinfo, ParkManager parkManagerByEnterOperatorId, ParkManager parkManagerByReservationOperatorId, String poNo, Short poType, String carNo, Timestamp orderTime, String carColor, String carBrand, Timestamp enterTime, Timestamp leaveTime, Long enterImg, Long leaveImg, Double reservationDuration, Double actualDuration, Double reservationAmount, Double receivableAmount, Double actualAmount, Double diffAmount, Double parkPrice, String changeAmountReason, Short carportCount, Short commentStatus, Short reportStatus, Timestamp createTime, Timestamp updateTime, Short status, Set parkReports, Set userCreditRecords, Set transactionRecords, Set parkComments) {
        this.parkManagerByLeaveOperatorId = parkManagerByLeaveOperatorId;
        this.userinfo = userinfo;
        this.parkinfo = parkinfo;
        this.parkManagerByEnterOperatorId = parkManagerByEnterOperatorId;
        this.parkManagerByReservationOperatorId = parkManagerByReservationOperatorId;
        this.poNo = poNo;
        this.poType = poType;
        this.carNo = carNo;
        this.orderTime = orderTime;
        this.carColor = carColor;
        this.carBrand = carBrand;
        this.enterTime = enterTime;
        this.leaveTime = leaveTime;
        this.enterImg = enterImg;
        this.leaveImg = leaveImg;
        this.reservationDuration = reservationDuration;
        this.actualDuration = actualDuration;
        this.reservationAmount = reservationAmount;
        this.receivableAmount = receivableAmount;
        this.actualAmount = actualAmount;
        this.diffAmount = diffAmount;
        this.changeAmountReason = changeAmountReason;
        this.carportCount = carportCount;
        this.commentStatus = commentStatus;
        this.reportStatus = reportStatus;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.status = status;
        this.parkReports = parkReports;
        this.userCreditRecords = userCreditRecords;
        this.transactionRecords = transactionRecords;
        this.parkComments = parkComments;
    }

   
    // Property accessors

    public Long getPoId() {
        return this.poId;
    }
    
    public void setPoId(Long poId) {
        this.poId = poId;
    }

    public ParkManager getParkManagerByLeaveOperatorId() {
        return this.parkManagerByLeaveOperatorId;
    }
    
    public void setParkManagerByLeaveOperatorId(ParkManager parkManagerByLeaveOperatorId) {
        this.parkManagerByLeaveOperatorId = parkManagerByLeaveOperatorId;
    }

    public Userinfo getUserinfo() {
        return this.userinfo;
    }
    
    public void setUserinfo(Userinfo userinfo) {
        this.userinfo = userinfo;
    }

    public Parkinfo getParkinfo() {
        return this.parkinfo;
    }
    
    public void setParkinfo(Parkinfo parkinfo) {
        this.parkinfo = parkinfo;
    }

    public ParkManager getParkManagerByEnterOperatorId() {
        return this.parkManagerByEnterOperatorId;
    }
    
    public void setParkManagerByEnterOperatorId(ParkManager parkManagerByEnterOperatorId) {
        this.parkManagerByEnterOperatorId = parkManagerByEnterOperatorId;
    }

    public ParkManager getParkManagerByReservationOperatorId() {
        return this.parkManagerByReservationOperatorId;
    }
    
    public void setParkManagerByReservationOperatorId(ParkManager parkManagerByReservationOperatorId) {
        this.parkManagerByReservationOperatorId = parkManagerByReservationOperatorId;
    }

    public String getPoNo() {
        return this.poNo;
    }
    
    public void setPoNo(String poNo) {
        this.poNo = poNo;
    }

    public Short getPoType() {
        return this.poType;
    }
    
    public void setPoType(Short poType) {
    	
    	
        this.poType = poType;
         //订单类型（1：预约停车；2：未预约停车）',
         switch(poType){
         case 1:
         	this.setTypeName("预约停车");
         	break;
         case 2:
         	this.setTypeName("未预约停车");
         	break;
         default:
         	this.setStatusName("未知");
         }
    }

    public String getCarNo() {
        return this.carNo;
    }
    
    public void setCarNo(String carNo) {
        this.carNo = carNo;
    }

    public Timestamp getOrderTime() {
        return this.orderTime;
    }
    
    public void setOrderTime(Timestamp orderTime) {
        this.orderTime = orderTime;
    }

    public String getCarColor() {
        return this.carColor;
    }
    
    public void setCarColor(String carColor) {
        this.carColor = carColor;
    }

    public String getCarBrand() {
        return this.carBrand;
    }
    
    public void setCarBrand(String carBrand) {
        this.carBrand = carBrand;
    }

    public Timestamp getEnterTime() {
        return this.enterTime;
    }
    
    public void setEnterTime(Timestamp enterTime) {
        this.enterTime = enterTime;
    }

    public Timestamp getLeaveTime() {
        return this.leaveTime;
    }
    
    public void setLeaveTime(Timestamp leaveTime) {
        this.leaveTime = leaveTime;
    }

    public Long getEnterImg() {
        return this.enterImg;
    }
    
    public void setEnterImg(Long enterImg) {
        this.enterImg = enterImg;
    }

    public Long getLeaveImg() {
        return this.leaveImg;
    }
    
    public void setLeaveImg(Long leaveImg) {
        this.leaveImg = leaveImg;
    }

    public Double getReservationDuration() {
        return this.reservationDuration;
    }
    
    public void setReservationDuration(Double reservationDuration) {
        this.reservationDuration = reservationDuration;
    }

    public Double getActualDuration() {
        return this.actualDuration;
    }
    
    public void setActualDuration(Double actualDuration) {
        this.actualDuration = actualDuration;
    }

    public Double getReservationAmount() {
        return this.reservationAmount;
    }
    
    public void setReservationAmount(Double reservationAmount) {
        this.reservationAmount = reservationAmount;
    }

    public Double getReceivableAmount() {
    	if(receivableAmount==null)
    		return 0.0;
        return this.receivableAmount;
    }
    
    public void setReceivableAmount(Double receivableAmount) {
        this.receivableAmount = receivableAmount;
    }

    public Double getActualAmount() {
        return this.actualAmount;
    }
    
    public void setActualAmount(Double actualAmount) {
        this.actualAmount = actualAmount;
    }

    public Double getDiffAmount() {
        return this.diffAmount;
    }
    
    public void setDiffAmount(Double diffAmount) {
        this.diffAmount = diffAmount;
    }

    public String getChangeAmountReason() {
        return this.changeAmountReason;
    }
    
    public void setChangeAmountReason(String changeAmountReason) {
        this.changeAmountReason = changeAmountReason;
    }

    public Short getCarportCount() {
        return this.carportCount;
    }
    
    public void setCarportCount(Short carportCount) {
        this.carportCount = carportCount;
    }

    public Short getCommentStatus() {
        return this.commentStatus;
    }
    
    public void setCommentStatus(Short commentStatus) {
        this.commentStatus = commentStatus;
    }

    public Short getReportStatus() {
        return this.reportStatus;
    }
    
    public void setReportStatus(Short reportStatus) {
        this.reportStatus = reportStatus;
    }

    public Timestamp getCreateTime() {
        return this.createTime;
    }
    
    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public Timestamp getUpdateTime() {
        return this.updateTime;
    }
    
    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    public Short getStatus() {
        return this.status;
    }
    
//    public void setStatus(Short status) {
//        this.status = status;
//    }

    public Set getParkReports() {
        return this.parkReports;
    }
    
    public void setParkReports(Set parkReports) {
        this.parkReports = parkReports;
    }

    public Set getUserCreditRecords() {
        return this.userCreditRecords;
    }
    
    public void setUserCreditRecords(Set userCreditRecords) {
        this.userCreditRecords = userCreditRecords;
    }

    public Set getTransactionRecords() {
        return this.transactionRecords;
    }
    
    public void setTransactionRecords(Set transactionRecords) {
        this.transactionRecords = transactionRecords;
    }

    public Set getParkComments() {
        return this.parkComments;
    }
    
    public void setParkComments(Set parkComments) {
        this.parkComments = parkComments;
    }
   
    public void setStatus(Short status) {
        this.status = status;
        //订单状态:-3：超时未支付的订单；-2：超时未确认定的订单；-1：管理员确认无法预订；0：订单已取消；1：等待收费员确认订单；2：未支付；3：已支付；4：已结单
        switch(status){
        case -3:
        	this.setStatusName("超时未支付的订单");
        	break;
        case -4:
        	this.setStatusName("已删除");
        	break;
        case -2:
        	this.setStatusName("超时未确认定的订单");
        	break;
        case -1:
        	this.setStatusName("管理员确认无法预订");
        	break;
        case 0:
        	this.setStatusName("订单已取消");
        	break;
        case 1:
        	this.setStatusName("等待收费员确认订单");
        	break;
        case 2:
        	this.setStatusName("未支付");
        	break;
        case 3:
        	this.setStatusName("已支付");
        	break;
        case 4:
        	this.setStatusName("已结单");
        	break;
        case 5:
        	this.setStatusName("逃废账单");
        	break;
        case 20:
        	this.setStatusName("已完结");
        	break;
        default:
        	this.setStatusName("未知");
        	
        }
    }

	/**
	 * @return the statusName
	 */
	public String getStatusName() {
		return statusName;
	}

	/**
	 * @param statusName the statusName to set
	 */
	public void setStatusName(String statusName) {
		this.statusName = statusName;
	}

	/**
	 * @return the extendInfo
	 */
	public String getExtendInfo() {
		return extendInfo;
	}

	/**
	 * @param extendInfo the extendInfo to set
	 */
	public void setExtendInfo(String extendInfo) {
		this.extendInfo = extendInfo;
	}

	public String getTypeName() {
		return typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	public Integer getYear() {
		return year;
	}

	public void setYear(Integer year) {
		this.year = year;
	}

	public Integer getMonth() {
		return month;
	}

	public void setMonth(Integer month) {
		this.month = month;
	}

	public Integer getDay() {
		return day;
	}

	public void setDay(Integer day) {
		this.day = day;
	}

	public Long getCountOrder() {
		return countOrder;
	}

	public void setCountOrder(Long countOrder) {
		this.countOrder = countOrder;
	}

	public Double getShimoney() {
		return shimoney;
	}

	public void setShimoney(Double shimoney) {
		this.shimoney = shimoney;
	}

	public Double getChamoney() {
		return chamoney;
	}

	public void setChamoney(Double chamoney) {
		this.chamoney = chamoney;
	}
	public Double getYinmoney() {
		return yinmoney;
	}
	public void setYinmoney(Double yinmoney) {
		this.yinmoney = yinmoney;
	}

	public Double getSummoney() {
		return summoney;
	}

	public void setSummoney(Double summoney) {
		this.summoney = summoney;
	}

	public Long getCountType() {
		return countType;
	}

	public void setCountType(Long countType) {
		this.countType = countType;
	}





}